package com.akoj.anmu.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 封装
 * @param <T> 返回结果中data的数据类型
 */
@ApiModel(description = "通用返回对象")
@Data
public class BaseResponse<T> implements Serializable {

    private static final long serialVersionUID = 1425320558744379382L;

    /**
     * 状态码
     */
    @ApiModelProperty(value = "响应码")
    private Integer code;

    /**
     * 响应结果
     */
    @ApiModelProperty(value = "响应结果")
    private T data;

    /**
     * 响应信息
     */
    @ApiModelProperty(value = "响应信息")
    private String message;

    public BaseResponse(Integer code, T data, String message){
        this.code = code;
        this.data = data;
        this.message = message;
    }

}
